/*
 * calculation.h
 * Perform the calculation using the results from the simulated radio.
 *
 *  Created on: Oct 20, 2014
 *      Author: andy
 */

#ifndef CALCULATION_H_
#define CALCULATION_H_

struct CalcResults {
	int displacement;   // Needle displacement, in degrees

	enum ToFrom {
		TO,
		FROM,
		UNKNOWN
	};
	ToFrom direction;   // TO/FROM indicator

	bool valid;         // Valid data?

	bool areResultsValid();
};

bool calculate(int actual_radial, int desired_radial, bool valid, CalcResults &results);

// rotate is exported for testing purposes only.
int rotate(int base, int r);


#endif /* CALCULATION_H_ */
